home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8505.arc
/
OSCILL.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-09-14
|
2KB
|
45 lines
10 ' PC OSCILLOSCOPE -- Copyright 1984 Michael A. Covington
20 ' A graphics adaptation of PC Voltmeter.
30 ' Requires the same input and calibration procedure.
50 CLS : KEY OFF
60 PRINT:PRINT "PC OSCILLOSCOPE"
80 PRINT "Connect first calibration voltage, ";
85 PRINT "then press any key."
90 IF INKEY$="" THEN 90
100 READING1 = 1/STICK(0)
110 PRINT:PRINT "Reading taken."
130 INPUT "Value of that voltage (in volts)";VOLTAGE1
140 PRINT
150 PRINT "Connect second calibration voltage, ";
155 PRINT "then press any key."
160 IF INKEY$="" THEN 160
170 READING2 = 1/STICK(0)
180 PRINT:PRINT "Reading taken."
200 INPUT "Value of that voltage (in volts)";VOLTAGE2
210 FACTOR = (READING2-READING1)/(VOLTAGE2-VOLTAGE1)
220 OFFSET = READING2 - (VOLTAGE2*FACTOR)
230 PRINT "Calibrated"
240 PRINT:PRINT
260 PRINT "Press any key to start."
270 PRINT "A beep will signal that the trace is"
280 PRINT "complete; you may then press any key"
290 PRINT "to start another one."
300 IF INKEY$="" THEN 300
310 SCREEN 1,0 : CLS
320 LINE (0,0)-(320,0)
330 LINE -(320,200)
340 LINE -(0,200)
350 LINE -(0,0)
360 LOCATE 2,2:PRINT "PC Oscilloscope"
370 X=10
380 WHILE X<301
390 VOLTAGE = ((1/STICK(0))-OFFSET)/FACTOR
400 IF VOLTAGE>5 THEN VOLTAGE=5
410 IF VOLTAGE<0 THEN VOLTAGE=0
420 Y = 185 - 30*VOLTAGE
430 PSET(X,Y)
440 X=X+1
450 WEND
460 BEEP
470 IF INKEY$="" THEN 470 ELSE 310